Next | Prev | Up | Top | Contents | Index

Using a Delayed System Buffer Flush

When your application has both clearly defined times when all unplanned disk activity should be prevented, and clearly defined times when disk activity can be tolerated, you can use the syssgi() function to control the kernel's automatic disk writes.

Prior to a critical section of length s seconds that must not be interrupted by unplanned disk writes, use syssgi() as follows:

syssgi(SGI_BDFLUSHCNT,s);

The kernel will not initiate any deferred disk writes for s seconds. At the start of a period when disk activity can be tolerated, initiate a flush of the kernel's buffered writes with syssgi() as follows:

syssgi(SGI_SSYNC);

Note: This technique is most useful in a uniprocessor--code executing in an isolated CPU of a multiprocessor is not affected by kernel disk writes.


Next | Prev | Up | Top | Contents | Index